/*
	Copyright 2007-2010 Petr Ohlidal

	This file is a part of GrobMaker

	GrobMaker is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	GrobMaker is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with GrobMaker.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef GROBMAKER_INPUTDATA
#define GROBMAKER_INPUTDATA

/** @file */

#include "Global.hpp"
#include <list>
#include "Pegs/PegInputData.hpp"
#include "Pegs/PegFileList.hpp"
#include "Util/FileInfo.hpp"

namespace GrobMaker{


class InputData{

public:

	std::list<std::string> pegNamesStack;
	int spriteTargetW;
	int spriteTargetH;
	fs::path shadePath;
	bool singleShade;
	std::list<FileInfo> shadeFiles;
	fs::path pivotPath;
	bool singlePivot;
	std::list<FileInfo> pivotFiles;
	fs::path spritePath; // Full path to directory or single sprite image.
	bool singleSprite;
	std::list<FileInfo> spriteFiles;
	std::list< PegInputData > pegs;
	std::list< PegFileList > pegFileLists;
	bool pegsAutoDetected;
	int noAngles;
	static const int noAnglesUnspecified=-1;
	fs::path scriptPath;
	float shadowAlpha;
	bool shadowParse; //<Shadow parsing mode.
	fs::path grobDir;
	fs::path sourceDir;
	bool omitShades; // If the object is flat and thus the shade would match the imageArea, don't save shades.
	std::string grobName;
	GrobdirExistsAction grobdirExistsAction;
	std::string imgOutputExtension;
	FREE_IMAGE_FORMAT imgOutputFormat;
	int imgOutputFlags;
	bool omitPegs;

	InputData():
		sourceDir(".")
	{
		noAngles=-1;
		shadowAlpha=DEFAULT_SHADOW_ALPHA;
		this->pegsAutoDetected=false;
		this->omitShades=false;
		grobdirExistsAction = ASK_ACTION;
		imgOutputFlags=0;
		this->spriteTargetH=0;
		this->spriteTargetW=0;
		this->omitPegs=false;
		this->shadowParse=false;
	}
	void addPegFileList( PegFileList l ){
		this->pegFileLists.push_back(l);
	}
	void addPeg(PegInputData pegData){
		pegs.push_back(pegData);
	}
	int getPegCount() const{
		return this->pegs.size();
	}
	int getSpriteStep() const{
		return 360/noAngles;
	}
	/**
	* Checks if the supplied file is a sprite resource (single sprite image or dir)
	* @return True if resource was found, false otherwise.
	*/
	bool checkSpritesResource( const FileInfo& file );
};

} // namespace GrobMaker

#endif //#ifndef GROBMAKER_INPUTDATA
